home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
s-gikan2.maizuru-ct.ac.jp
/
s-gikan2.maizuru-ct.ac.jp.zip
/
s-gikan2.maizuru-ct.ac.jp
/
pub
/
old
/
ncvc351d_install.exe
/
{app}
/
scripts
/
add_sequence_number.pl
< prev
next >
Wrap
Perl Script
|
2004-04-02
|
849b
|
39 lines
#! /usr/bin/perl
# NCâfü[â^é╔âVü[âPâôâXö╘ìåé≡òtë┴é╖éΘâXâNâèâvâg #
# ö╘ìåé¬ôⁿé┴é─éóéΘìsé╞ôⁿé┴é─éóé╚éóìsé¬ì¼é┤é┴é─éóéΘÅΩìçé═ #
# æSé─ÉVé╡éóö╘ìåé╔é┬é»é╚é¿é╖ #
######################################
#ìsö╘ìåé╠îàÉöé≡ôⁿéΩé─é¡é╛é│éóüB
$K= 4;
#ìsö╘ìåé╠ɵô¬é╠ö╘ìåé≡ôⁿéΩé─é¡é╛é│éóüB
$lead_number= 1000;
#ìsö╘ìåé╠æ¥ë┴Éöé≡ôⁿéΩé─é¡é╛é│éóüB
$increase_number= 10;
######################################
$line_number= $lead_number;
$pre_file= $ARGV[0];
$out_file= $ARGV[1];
open(IN,$pre_file);
open(OUT,">$out_file");
while(<IN>){
if(/^([A-NP-Z])[\-\d\.]+/){
if($1 eq "N"){ $_= $'; }
$k= length($line_number);
if($k < $K){ $line_number= "0"x($K-$k).$line_number; }
$_= "N".$line_number.$_;
$line_number += $increase_number;
}
print OUT;
}
close(OUT);
close(IN);